home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
015a
/
unique2.zip
/
UNIQUE.DOC
< prev
Wrap
Text File
|
1991-04-22
|
2KB
|
40 lines
UNIQUE.COM
Replaces one of the batch file parameters (%1 - %9) with an 8 character
unique file name (i.e. the name of a file that does not already exist in
the current directory). Unique does not create the file, it just finds
a name.
USAGE: UNIQUE n where n is the number of the parameter to be replaced
An example of a batch file that uses unique follows:
ECHO OFF
...
REM Some batch statements
...
UNIQUE 2
COPY OldData %2
...
REM Some more batch statements
...
TYPE %2
DEL %2
The command line statement calling this batch file would look something like:
DOBATCH Parameter1 12345678 AnotherParameter
The parameter 12345678 is a dummy parameter that will be replaced by the
unique file name. It must be 8 characters long. When the batch file gets
to the line 'UNIQUE 2' Unique executes and replaces the second parameter on
the command line with the unique file name. If the second parameter does not
exists or is not 8 characters long then Unique aborts with an error message.
After this line has been executed %2 contains the unique name so
'COPY OldDate %2' copys the file OldData to the unique file found by Unique.
ERRORLEVELs returned are: 1 - No parameter # specified
2 - Parameter # specifed does not exists
3 - Parameter # specifed is not 8 characters long
4 - A unique file name could not be found